<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="wf" uri="/augurit-wf"%>
 <%@page import="com.augurit.common.system.web.auth.form.LoginUserForm"%>
 <%LoginUserForm form=(LoginUserForm)request.getSession().getAttribute("SES_LOGIN_USER"); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- dwr libs -->
<%@ include file="/smartform/public/meta_smartform.jsp"%>
<%@ include file="/smartform/public/meta_smartform_ext.jsp"%>
<%@ include file="/smartform/public/meta_smartform_wf.jsp"%>
<%@ include file="/smartform/public/meta_smartform_oa.jsp"%>
<link href="${ctx}/gzcgwsp/resources/css/common-ui.css" rel="stylesheet" type="text/css" />
<script src="${ctx}/resources/components/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<!-- 打印 -->
<script language="JavaScript" src="${ctx}/resources/components/ntko/OfficeContorlFunctions.js"></script>
<script language="JavaScript" src="${ctx}/wf/client/common/js/wf-attachment-public.js"></script>

<script type="text/javascript">
$(document).ready(function(){
 var activityName=parent.WF_CONFIG.activityName;//gzryczh
	if(activityName!="gzryczh"){
		document.getElementById("fzh").readOnly=true;
	}
 	if(activityName == "jbrsj"){//区经办人办结环节可以打印呈批表
		document.getElementById("printCpb").style.display='block';
 	}else{//其他环节不可以打印
 		document.getElementById("printCpb").style.display='none';
 	}
});


//生成发证号
function createZsbh(){
  //请在此处编写客户端代码
  var id=parent.document.getElementById('shljqs_formIframe').contentWindow.document.getElementsByName("id")[0].value;
		 if(id!=""){
		 	var action="smart-form-shljqs!createZsbh.action?id="+id+"&tablename=HW_SHLJQS_V1"+"&taskId="+parent.WF_CONFIG.taskInstDbid+"&actname=gzryczh&zsname=fzh";
			 	 Ext.Ajax.request({
			       url: action,
			       params:"",
			       success:function(response){
				
		 	        var zsbh=response.responseText;
		  	        document.getElementsByName("shljqscpb_fzh")[0].value=zsbh;
			     }
	  		});	
		}
}

function writeJudgment(index) {
    var divid = '';
     var tiDbId = parent.WF_CONFIG.taskInstDbid
    switch(index) {
        case 'A': divid = 'jbrJudgment'; break;
        case 'B': divid = 'deptJudgment'; break;
        case 'C': divid = 'leadershipJudgment'; break;
        case 'D': divid = 'jbrJudgmentYQ'; break;
        case 'E': divid = 'quJbrJudgment'; break;
        case 'F': divid = 'kzJudgment'; break;
        case 'G': divid = 'fjldJudgment'; break;
        case 'H': divid = 'jldJudgment'; break;
       
    }
    var divobj = document.getElementById(divid);
    if (divid == '' || !divobj) {
        alert('参数错误！');
        return;
    }
    var win = new Ext.ux.wf.WfOpinionWin({
      taskInstDbid: tiDbId
    });
    win.show();
    win.on('complete', function (opinion) {
    changeOpinion(opinion, divobj);    
  });
}

function inputJudgment(index) {
    var divid = '', inputid = '';
    switch(index) {
        case 'A': divid = 'jbrJudgment'; inputid = 'jbrJudgmentInput'; break;
        case 'B': divid = 'deptJudgment'; inputid = 'deptJudgmentInput'; break;
        case 'C': divid = 'leadershipJudgment'; inputid = 'leadershipJudgmentInput'; break;
        case 'D': divid = 'fczJudgment'; inputid = 'fczJudgmentInput'; break;
        case 'E': divid = 'qujbrJudgment'; inputid = 'qujbrJudgmentInput'; break;
        case 'F': divid = 'kzJudgment'; inputid = 'kzJudgmentInput'; break;
         case 'G': divid = 'fjldJudgment'; inputid = 'fjldJudgmentInput'; break;
        case 'H': divid = 'jldJudgment'; inputid = 'jldJudgmentInput'; break;
    }
    var divobj = document.getElementById(divid);
    var inputobj = document.getElementById(inputid);
    if (divid == '' || !divobj) {
        alert('参数错误！');
        return;
    }
    if (inputobj.value == '') { alert('请输入意见!'); return; }
    
    Ext.Ajax.request({
      method:'post',
      url:'${ctx}/wf!saveTaskOpinion.action',
      params:{
        'instance.taskInstDbid': parent.WF_CONFIG.taskInstDbid,
        'instance.handleComments': inputobj.value
      },
      success:function(){
      changeOpinion(inputobj.value, divobj);
        inputobj.value = '';
      },
      scope:this
    });
}

function changeOpinion(opinion, divobj) {
  var userOpinion = document.getElementById('userOpinion');
  if (userOpinion) {
    userOpinion.innerHTML = opinion + '<br>&nbsp;&nbsp;&nbsp;&nbsp;${CurrUserName}&nbsp;&nbsp;' + getNowDate();
  } else {
    divobj.style.color = '#009966';
    divobj.innerHTML = opinion + '<br>&nbsp;&nbsp;&nbsp;&nbsp;${CurrUserName}&nbsp;&nbsp;' + getNowDate();
  }
}


function getNowDate(){
	var date=new Date();
	var month=date.getMonth() + 1;
	var year=date.getFullYear();
	var day=date.getDate();
	var hours=date.getHours(); 
	var m=date.getMinutes(); 
	var s=date.getSeconds();
	if(month<10){
	   month="0"+month;
	}
	if(day<10){
	  day="0"+day;
	}
 return year+"-"+month+"-"+day+" "+hours+":"+m+":"+s;
}
//打印呈批表
function printCpb(){
	var viewName = parent.WF_CONFIG.viewName;
	var url = '${ctx}/smart-form-shljqs!printcz.action?id=${id}&templateCode=${templateCode}&fileCode=hwcCpb&taskInstDbid=${taskInstDbid}&viewName='+viewName;
	window.open(url);
}
</script>

</head>
<body align="center">
	

	
  <table width="700" align="center" border="0" cellspacing="2" cellpadding="2">
      <tr>
        <td><table width="100%" border="0" cellspacing="2" cellpadding="2">
          <tr><td height="55" bordercolor="#000000" align="center" style="font-size:22px;">
            <br /><b>从事城市生活垃圾经营性清扫、收集、运输服务许可呈批表 </b><br />
            	<center>
					<input type="button" id="printCpb" value="打印呈批表" onclick="printCpb();"/>
				</center>
          </td></tr>
        </table></td>
      </tr>
            <tr>
              <td><table width="100%" border="1" cellspacing="0" cellpadding="2" class="tpl_list_ui">
                <tr>
                  <td width="15%" height="0"></td>
                  <td width="10%"></td>
                  <td width="10%"></td>
                  <td width="10%"></td>
                  <td width="10%"></td>
                  <td width="10%"></td>
                  <td width="10%"></td>
                  <td width="10%"></td>
                  <td width="10%"></td>
                  <td width="10%"></td>
                </tr>
                <tr>
                  <td bordercolor="#000000" colspan="2" height="25" align="center">受理号</td>
                  <td colspan="" bordercolor="#000000" style="padding: 1px 1px 1px 1px;">
                    <input name="acceptNo" value="${acceptNo}" type="text" style="width:100%" class="readonly_cls" readonly />
                  </td>
                
                  <td bordercolor="#000000" colspan="1" height="25" align="center">收件时间</td>
                  <td colspan="2" bordercolor="#000000" style="padding: 1px 1px 1px 1px;">
                    <input name="tbrq" value="<s:date name='tbrq' format="yyyy年MM月dd日"/>" type="text" style="width:100%" class="readonly_cls" readonly/>
                  </td>
                   <td bordercolor="#000000" colspan="2" height="25" align="center">答复期限</td>
                  <td colspan="3" bordercolor="#000000" style="padding: 1px 1px 1px 1px;">
                    <input name="dfsj" value="<s:date name='dfsj' format="yyyy年MM月dd日"/>" style="width:100%" onclick="WdatePicker({skin:'ext', dateFmt:'yyyy年MM月dd日'});" type="text" class="textdocWdate" readonly/>
                  </td>
                </tr>
                <tr>
              <td bordercolor="#000000" colspan="2" height="25" align="center">申请单位</td>
                  <td colspan="8" bordercolor="#000000" style="padding: 1px 1px 1px 1px;">
                    <input id="sqdw_" name="sqdw_" value="${sqdw}" type="text" style="width:100%" class="readonly_cls" readonly />
                  </td>
                </tr>
                <tr>
                  <td bordercolor="#000000" colspan="2" height="25" align="center">申请业务</td>
                  <td colspan="4" bordercolor="#000000" style="padding: 1px 1px 1px 1px;">
                    <input class="text" name="cbyw" value="${cbyw}" type="text" style="width:100%" class="readonly_cls" readonly />
                  </td>
                   <td colspan="" align="center" bordercolor="#000000" style="padding: 1px 1px 1px 1px;">区域</td>
                   <td colspan="3" bordercolor="#000000" style="padding: 1px 1px 1px 1px;">
                    <input class="text" name="area" value="${area}" type="text" style="width:100%" class="readonly_cls" readonly />
                  </td>
                </tr>
                
                <tr>
                  <td bordercolor="#000000" colspan="2" height="80" align="center">调查情况和经办人意见</td>
                  <td colspan="8" bordercolor="#000000" style="padding:1px 1px 1px 1px;">
                    <div style="padding:5px 5px 5px 5px;height:60px;">
                    <wf:opinion activities="jbryskc" name="opinions_jbr"/>
                    <div id="qujbrJudgment"></div>
                    </div>
                    <wf:textarea id="qujbrJudgmentInput" name="qujbrJudgmentInput" rows="3" cols="150" style="width:100%" >${qujbrJudgmentInput}</wf:textarea>
                    <wf:input type="button" name="quJbrBtn" id="quJbrBtn" value="填写意见" cssClass="tpl_ui_btn" onclick="inputJudgment('E');" />
                    <wf:input type="button" name="quJbrJudgmentBtn" id="quJbrJudgmentBtn" value="常用意见" cssClass="tpl_ui_btn" onclick="writeJudgment('E');" />
                  </td>
                </tr>
                <tr>
                  <td bordercolor="#000000" colspan="2" height="80"  align="center">主管科室初步审查意见</td>
                  <td colspan="8" bordercolor="#000000" style="padding:1px 1px 1px 1px;">
                    <div style="padding:5px 5px 5px 5px;height:60px;">
                    <wf:opinion activities="kzyj" name="opinions_jbr"/>
                    <div id="kzJudgment"></div>
                    </div>
                    <wf:textarea id="kzJudgmentInput" name="kzJudgmentInput" rows="3" cols="150" style="width:100%" >${jbrJudgmentInput}</wf:textarea>
                    <wf:input type="button" name="qukzBtn" id="qukzBtn" value="填写意见" cssClass="tpl_ui_btn" onclick="inputJudgment('F');" />
                    <wf:input type="button" name="qukzJudgmentBtn" id="qukzJudgmentBtn" value="常用意见" cssClass="tpl_ui_btn" onclick="writeJudgment('F');" />
                  </td>
                </tr>
                  <tr>
                  <td bordercolor="#000000" colspan="2" height="80" align="center">分管领导复核意见</td>
                  <td colspan="8" bordercolor="#000000" style="padding:1px 1px 1px 1px;">
                    <div style="padding:5px 5px 5px 5px;height:60px;">
                    <wf:opinion activities="jfgld" name="opinions_jbr"/>
                    <div id="fjldJudgment"></div>
                    </div>
                    <wf:textarea id="fjldJudgmentInput" name="fjldJudgmentInput" rows="3" cols="150" style="width:100%" >${jbrJudgmentInput}</wf:textarea>
                    <wf:input type="button" name="fjldBtn" id="fjldBtn" value="填写意见" cssClass="tpl_ui_btn" onclick="inputJudgment('G');" />
                    <wf:input type="button" name="fjldJudgmentBtn" id="fjldJudgmentBtn" value="常用意见" cssClass="tpl_ui_btn" onclick="writeJudgment('G');" />
                  </td>
                </tr>
                <tr>
                  <td bordercolor="#000000" colspan="2" height="80" align="center">局领导意见</td>
                  <td colspan="8" bordercolor="#000000" style="padding:1px 1px 1px 1px;">
                    <div style="padding:5px 5px 5px 5px;height:60px;">
                    <wf:opinion activities="jldyj" name="opinions_jbr"/>
                    <div id="jldJudgment"></div>
                    </div>
                    <wf:textarea id="jldJudgmentInput" name="jldJudgmentInput" rows="3" cols="150" style="width:100%" >${jbrJudgmentInput}</wf:textarea>
                    <wf:input type="button" name="jldBtn" id="jldBtn" value="填写意见" cssClass="tpl_ui_btn" onclick="inputJudgment('H');" />
                    <wf:input type="button" name="jldJudgmentBtn" id="jldJudgmentBtn" value="常用意见" cssClass="tpl_ui_btn" onclick="writeJudgment('H');" />
                  </td>
                </tr>
                <tr>
                  <td bordercolor="#000000" colspan="2" height="80" align="center">处经办人意见</td>
                  <td colspan="8" bordercolor="#000000" style="padding:1px 1px 1px 1px;">
                    <div style="padding:5px 5px 5px 5px;height:60px;">
                    <wf:opinion activities="gzryfh,gzryczh" name="opinions_jbr"/>
                    <div id="jbrJudgment"></div>
                    </div>
                    <wf:textarea id="jbrJudgmentInput" name="jbrJudgmentInput" rows="3" cols="150" style="width:100%" >${jbrJudgmentInput}</wf:textarea>
                    <wf:input type="button" name="chuJbrBtn" id="chuJbrBtn" value="填写意见" cssClass="tpl_ui_btn" onclick="inputJudgment('A');" />
                    <wf:input type="button" name="chuJbrJudgment" id="chuJbrJudgment" value="常用意见" cssClass="tpl_ui_btn" onclick="writeJudgment('A');" />
                  </td>
                </tr>
                <tr>
                  <td bordercolor="#000000" colspan="2" height="80" align="center">副处长意见</td>
                  <td colspan="8" bordercolor="#000000" style="padding:1px 1px 1px 1px;">
                    <div style="padding:5px 5px 5px 5px;height:60px;">
                    <wf:opinion activities="fcfgldsh,fczyj,fczsh" name="opinions_dept"/>
                    <div id="fczJudgment"></div>
                    </div>
                    <!--  
                    <textarea id="DeptJudgmentInput" name="DeptJudgmentInput" rows="3" style="width:100%"></textarea>
                    -->
                    <wf:textarea id="fczJudgmentInput" name="fczJudgmentInput" rows="3" cols="150" style="width:100%" >${fczJudgmentInput}</wf:textarea>
                    <wf:input type="button" name="fczBtn" id="fczBtn" value="快速填写" cssClass="tpl_ui_btn" onclick="inputJudgment('D');" />
                    <wf:input type="button" name="fczJudgmentBtn" id="fczJudgmentBtn" value="常用意见" cssClass="tpl_ui_btn" onclick="writeJudgment('D');" />
                  </td>
                </tr>
                <tr>
                  <td bordercolor="#000000" colspan="2" height="80" align="center">处长意见</td>
                  <td colspan="8" bordercolor="#000000" style="padding:1px 1px 1px 1px;">
                    <div style="padding:5px 5px 5px 5px;height:60px;">
                    <wf:opinion activities="czsh,czgldsh" name="opinions_dept"/>
                    <div id="deptJudgment"></div>
                    </div>
                    <!--  
                    <textarea id="DeptJudgmentInput" name="DeptJudgmentInput" rows="3" style="width:100%"></textarea>
                    -->
                    <wf:textarea id="deptJudgmentInput" name="deptJudgmentInput" rows="3" cols="150" style="width:100%" >${deptJudgmentInput}</wf:textarea>
                    <wf:input type="button" name="DeptBtn" id="DeptBtn" value="快速填写" cssClass="tpl_ui_btn" onclick="inputJudgment('B');" />
                    <wf:input type="button" name="DeptJudgment" id="DeptJudgment" value="常用意见" cssClass="tpl_ui_btn" onclick="writeJudgment('B');" />
                  </td>
                </tr>
                <tr>
                  <td bordercolor="#000000" colspan="2" height="80" align="center">委领导意见</td>
                  <td colspan="8" bordercolor="#000000" style="padding:1px 1px 1px 1px;">
                    <div style="padding:5px 5px 5px 5px;height:60px;">
                    <wf:opinion activities="wldsh,wzgldsh,wzgldsp" name="opinions_leadership"/>
                    <div id="leadershipJudgment"></div>
                    </div>
                    <!--  
                    <textarea id="QyzzLeadershipInput" name="QyzzLeadershipInput" rows="3" style="width:100%"></textarea>
                    -->
                    <wf:textarea id="leadershipJudgmentInput" name="leadershipJudgmentInput" rows="3" cols="150" style="width:100%" >${leadershipJudgmentInput}</wf:textarea>
                    <wf:input type="button" name="LeadershipBtn" id="LeadershipBtn" value="快速填写" cssClass="tpl_ui_btn" onclick="inputJudgment('C');" />
                    <wf:input type="button" name="LeadershipJudgment" id="LeadershipJudgment" value="常用意见" cssClass="tpl_ui_btn" onclick="writeJudgment('C');" />
                  </td>
                </tr>
           <!-- 发证时间 -->     
       <tr>
        <td width="115" style="border-color:#000000;" colspan="2" align="center" height="30">
          <span style="font-size: 16px">发证时间</span>
        </td>
        
        <td width="390"  style="border-color:#000000;"   colspan="2" height="30">
         <input  name="shljqscpb_fzsj" type="text" id="field10186" readonly class="" value="${fzsjstr}" style="width:130px" onclick="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'});"/>
        </td>
        
         <td width="115" style="border-color:#000000;" colspan="2" align="center" height="30">
          <span style="font-size: 16px">发证号</span>
        </td>
        
        <td width="390"  style="border-color:#000000;"   colspan="6" height="30">
         <input  name="shljqscpb_fzh" type="text" id="fzh"  class="" value="${fzh}" style="width:130px" />
         <wf:input type="button" name="shljqscpb_fz" id="field10521" value="自动生成" cssClass="tpl_ui_btn" onclick="createZsbh()" />
       
        </td>
      </tr>
      
      
      
      <tr>
        <td width="115" style="border-color:#000000;" colspan="2" align="center" height="30">
          <span style="font-size: 16px">批准经营</span>
        </td>
        
        <td width="390"  style="border-color:#000000;"   colspan="8" height="30">
         <input  name="shljqscpb_kssj" type="text" id="field10202" readonly class="" value="${validstarttime}" style="width:130px" onclick="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'});"/>&#160;<b><span style="font-size: 16px">起</span></b>
        </td>
      </tr>
      <tr>
        <td width="115" style="border-color:#000000;" colspan="2" align="center" height="30">
          <span style="font-size: 16px">时间</span>
        </td>
        
        <td width="390" style="border-color:#000000;" colspan="8" height="30">
         <input  name="shljqscpb_jzsj" type="text" id="field10203" readonly class="" value="${validendtime}" style="width:130px" onclick="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd '});"/>&#160;<b><span style="font-size: 16px">止</span></b>
        </td>
      </tr>
                
              </table></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
            </tr>
         <tr>
        <td>&nbsp;</td>
      </tr>
    </table>
    
    </body>
    </html>